package com.stadium.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.stadium.bean.Order;
import com.stadium.bean.PlaceOrder;

public interface PlaceOrderRepository extends JpaRepository<PlaceOrder, Integer> {

	@Query("Select m FROM PlaceOrder m WHERE (?1 between m.startDate and m.endDate ) OR (?2 between m.startDate and m.endDate) AND (m.status=1 or m.status=0)")
	List<PlaceOrder> judgeTime(String startTime, String endTime);

	@Query("SELECT r FROM PlaceOrder r where r.status=?1")
	List<PlaceOrder> findAll(Integer type);

	List<PlaceOrder> findByBorrowAccount(String name);

}
